 /**
   * Copyright 2014 Viettel Telecom. All rights reserved.
   * VIETTEL PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
   */
 package com.viettel.core.bussiness.cms; 
import java.util.List; 

import org.springframework.beans.factory.annotation.Autowired; 

import com.viettel.core.exceptions.BusinessException; 
import com.viettel.core.exceptions.DataAccessException; 
import com.viettel.core.dao.cms.CmsUserDAO;
import com.viettel.core.entities.cms.CmsUser;
import com.viettel.core.entities.vo.AssignExpertFilter;
import com.viettel.core.entities.vo.AssignExpertVO;
import com.viettel.core.entities.vo.CMSUserSearchFilter;
import com.viettel.core.entities.vo.CMSUserSearchVO;
 /**
   *  Mo ta muc dich cua lop (interface)
   *  @author: TOANTM1
   *  @version:  
   *  @since: 27/02/2014 - 10:50:59
   */
 public class CmsUserMgrImpl implements CmsUserMgr{ 
	@Autowired 
	CmsUserDAO cmsuserDAO; 
 
 	/**@author TOANTM1
  	 * 27/02/2014 - 10:50:59
  	 * For: 
  	 * @description: 
  	 */
 	@Override 
	public CmsUser getCmsUserById(Integer id) throws BusinessException { 
		try { 
			return  cmsuserDAO.getCmsUserById(id); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	} 
 
 	/**@author TOANTM1
  	 * 27/02/2014 - 10:50:59
  	 * For: 
  	 * @description: 
  	 */
 	@Override 
	public CmsUser createCmsUser(CmsUser cmsuser) throws BusinessException { 
		try { 
			return cmsuserDAO.createCmsUser(cmsuser); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	} 
 
 	/**@author TOANTM1
  	 * 27/02/2014 - 10:50:59
  	 * For: 
  	 * @description: 
  	 */
 	@Override 
	public void updateCmsUser(CmsUser cmsuser) throws BusinessException { 
		try { 
			cmsuserDAO.updateCmsUser(cmsuser); 
		} catch (DataAccessException e) {	 
			throw new BusinessException(e); 
		} 
	} 
 
 	/**@author TOANTM1
  	 * 27/02/2014 - 10:50:59
  	 * For: 
  	 * @description: 
  	 */
 	@Override 
	public void deleteCmsUser(CmsUser cmsuser) throws BusinessException { 
		try { 
			cmsuserDAO.deleteCmsUser(cmsuser); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	}

	@Override
	public CmsUser getCmsUserByUserName(String userName)
			throws BusinessException {
		try { 
			return cmsuserDAO.getCmsUserByUserName(userName); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	}

	@Override
	public List<CMSUserSearchVO> searchCMSUser(CMSUserSearchFilter filter)
			throws BusinessException {
		try { 
			return cmsuserDAO.searchCMSUser(filter); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	}
	
	@Override
	public List<CMSUserSearchVO> searchCMSUserByType(CMSUserSearchFilter filter)
			throws BusinessException {
		try { 
			return cmsuserDAO.searchCMSUserByType(filter); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	}

	@Override
	public Boolean checkUserNameExist(String userName) throws BusinessException {
		try {
			return cmsuserDAO.checkUserNameExist(userName);
		} catch (DataAccessException e) {
			throw new BusinessException(e);
		}
	} 
	
	@Override
	public List<AssignExpertVO> searchExpertByFilter(AssignExpertFilter filter)
			throws BusinessException {
		try {
			return cmsuserDAO.searchExpertByFilter(filter);
		} catch (DataAccessException e) {
			throw new BusinessException(e);
		}
	} 
} 
